#!/bin/sh
#
# bash -- Start shell in a container with root for debugging
#
# Copyright (C) 2016-2021 Wu Zhangjin <falcon@ruma.tech>
#

TOP_DIR="$(cd "$(dirname "$0")"/../../ && pwd)"
. "$TOP_DIR"/tools/docker/config >/dev/null

prepare_login || exit 0

log_print "Get cached data"
[ -z "$UNIX_USER" ] && get_var UNIX_USER $DEF_USER
[ "x$HOST_OS" = x"Windows" ] && WINPTY="winpty"

log_print "Running docker bash of $CONTAINER_NAME"
do_op "$WINPTY docker exec -it -w $LAB_WORKDIR/$CURRENT -u $UNIX_USER" CONTAINER_NAME "//bin/bash"
